package com.example.demo.controller;

import com.example.demo.generator.CodeGenerator;
import com.example.demo.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 *
 *   @Author:Sjy
 *   @Date: 2024/3/12-03-12-20:36
 *   代码生成接口
 */
@Api(tags = "前端不要动！！")
@RestController
@RequestMapping("/generator")
public class GeneratorController {

  @Autowired
  private CodeGenerator codeGenerator;

  @ApiOperation(value = "生成代码接口")
  @PostMapping("/generateCode")
  public Result generateCode(String tableName,Boolean noController){
      codeGenerator.generator(tableName,noController);
      return Result.success().msg("代码生成成功");
  }

}
